using UnityEngine;

public class ElectricAnimator : FormAnimator {

    void OnDisable() {
        AnimatorComponent.ResetTrigger("Attack");
    }

    protected override void ConnectedFormController(FormController controller) {
        base.ConnectedFormController(controller);

        PlayerInput input = controller.GetComponent<PlayerInput>();
        input.OnAttack.AddListener(Attack);
    }

    void Attack() {
        if(gameObject.activeInHierarchy && !AnimatorComponent.GetCurrentAnimatorStateInfo(0).IsName("Attack"))
            AnimatorComponent.SetTrigger("Attack");
    }
}